package com.eascs.mq.dao;

import org.springframework.stereotype.Repository;

import com.eascs.admin.common.dao.BaseO2oDao;
import com.eascs.app.dao.PageResult;
import com.eascs.app.dao.SqlPageQuery;

@Repository
public class MqDao extends BaseO2oDao {

	public PageResult<Object[]> findByPage(int pageIndex, int pageSize) {
		SqlPageQuery<Object[]> sqlPageQuery = new SqlPageQuery<Object[]>(Object[].class, pageSize, pageIndex);
		StringBuffer querySql = new StringBuffer();// 查询语句拼接
		querySql.append(
				"SELECT t.msg_id,t.refer_id,t.msg_type,t.create_time,case t.status when 0 then '失败' else '成功' end as status from o2o_rabbitmq_msg t  where t.status = 0 ORDER BY t.create_time DESC");
		sqlPageQuery.setQuerySql(querySql.toString());
		return o2oJdbcSession.findDataWithPage(sqlPageQuery);
	}
}
